package com.wu.constant.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Cousin
 * @date 2024/12/27
 * @Description
 */
@AllArgsConstructor
@Getter
public enum MinIoNameEnum {
    SINGER_IMAGE("image-singer","defaultSingerImage.jpg"),SONG_IMAGE("image-song","defaultSongImage"),
    USER_IMAGE("image-user","defaultUserImage.jpg"), SONG_LIST_IMAGE("image-songList","defaultPlayListImage.jpg"),
    ALBUM_IMAGE("image-album","defaultAlbumImage.jpg"),
    MV_IMAGE("image-mv","defaultMvImage.jpg"),
    COMMUNITY_IMAGE("image-community","defaultCommunityImage.jpg"),
    MV("mvs",null),
    SONG("song",null),BANNER_IMAGE("banner",null);
    private final String bucketName;
    private final String defaultObjectName;
    public static String getObjectNameByBuckName(String bucketName) {
        for (MinIoNameEnum minIoNameEnum : MinIoNameEnum.values()) {
            if (minIoNameEnum.bucketName.equals(bucketName)){
                return minIoNameEnum.defaultObjectName;
            }
        }
        return null;
    }
    public static String getDefaultObjectName(Long id, String fileName) {
        return String.format("%d-%s", id, fileName);
    }
}
